package br.com.poc.pitagorasnumero.type;

import br.com.poc.pitagorasnumero.R;

/**
 * The Enum TypeSignificationDomain.
 * 
 * @author irlan.gomes
 */
public enum SignificationType {

	// RULES MADE WITH NAME
	/** The number expression. */
	NUMBER_EXPRESSION(R.string.num_expression),

	/** The number motivation. */
	NUMBER_MOTIVATION(R.string.num_motivation),

	/** The number personality. */
	NUMBER_PERSONALITY(R.string.num_personality),

	/** The number key. */
	NUMBER_KEY(R.string.num_key),

	/** The cornerstone. */
	CORNERSTONE(R.string.cornerstone),

	/** The desire instinctive. */
	DESIRE_INSTINCTIVE(R.string.desire_instinctive),

	/** The trends vocational problem health. */
	TRENDS_VOCATIONAL_PROBLEM_HEALTH(R.string.trends_vocational_problem_health),

	/** The number karma. */
	NUMBER_KARMA(R.string.num_karma),

	/** The trends hidden. */
	TRENDS_HIDDEN(R.string.trends_hidden),

	// RULES MADE WITH DATE OF BIRTH
	/** The number destination. */
	NUMBER_DESTINATION(R.string.num_destination),

	/** The first cycle. */
	FIRST_CYCLE(R.string.first_cycle),

	/** The secund cycle. */
	SECUND_CYCLE(R.string.secund_cycle),

	/** The third cycle. */
	THIRD_CYCLE(R.string.third_cycle),

	/** The first challenge. */
	FIRST_CHALLENGE(R.string.first_challenge),

	/** The secund challenge. */
	SECUND_CHALLENGE(R.string.secund_challenge),

	/** The third challenge. */
	THIRD_CHALLENGE(R.string.third_challange),

	/** The name formal. */
	NAME_FORMAL(R.string.name_formal),

	/** The nome pessoal. */
	NOME_PESSOAL(R.string.nome_pessoal),

	/** The default value. */
	DEFAULT_VALUE(R.string.default_value);

	/** The resource. */
	private int resource;

	/**
	 * Instantiates a new type signification domain.
	 * 
	 * @param resource
	 *            the resource
	 */
	private SignificationType(final int resource) {
		this.resource = resource;
	}

	/**
	 * Gets the resource.
	 * 
	 * @return the resource
	 */
	public int getResource() {
		return resource;
	}

	/**
	 * Gets the tipo significado domain.
	 * 
	 * @param valor
	 *            the valor
	 * @return the tipo significado domain
	 */
	public static SignificationType getTipoSignificadoDomain(final int valor) {

		SignificationType result = DEFAULT_VALUE;

		for (final SignificationType tipo : SignificationType.values()) {
			if (tipo.getResource() == valor) {
				result = tipo;
			}
		}

		return result;
	}

}
